module klang.编译.类型.类型_;
import 全局;
import std.conv: ·to = to;
import klang.编译.类型.枚举值.枚举值_: Extension, TK, SK;
import klang.编译.核心.核心_: 整数_, 词典_, 获取正规文件名函数_, 创建词典, 最小, 最大, 从后查找索引, 简单链表_;
import klang.编译.语法节点.节点_: 源文件_, 节点_, 节点数组_;
import klang.编译.工具.工具_: 创建文件诊断消息, 诊断收集_;
import klang.编译.路径.路径_: 转为路径, 获取目录路径, 目录分割符, 获取根长度;
import klang.编译.诊断.诊断_: 诊断消息_, 诊断_;
alias 遍历节点函数类型_ = bool delegate(节点_, bool delegate(节点_), bool delegate(节点数组_!(节点_)));
alias 源文件准备函数_ = 源文件_[][] delegate(源文件_[]);
alias 写文件回调_ = void delegate(dstring, dstring, bool, void delegate(dstring), 源文件_[]);
alias 转换工厂_(T) = 转换函数_!(T) delegate(转换上下文_);
alias 转换函数_(T) = T[] delegate(T);
alias OnSubstituteNode_ = 节点_ delegate(EmitHint, 节点_);
alias OnEmitNode_ = void delegate(EmitHint, 节点_, void delegate(EmitHint, 节点_));
alias 检查源文件函数_ = void delegate(源文件_);
alias 标识符字符判断函数_ = bool delegate(const(dchar));
alias 符号表_ = 词典_!(符号_);
alias 绑定函数_ = void delegate(节点_);
alias 绑定子函数_ = void delegate(节点_);
alias 初始源文件检查函数_ = void delegate(源文件_);
alias 检查初始化函数_ = void delegate();
alias 清理函数_ = void delegate();
enum 三元结果_ : int {
    初始_ = 0,
    假_ = 1,
    真_ = 2
}
enum LexicalEnvironmentFlags : int {
    None = 0,
    InParameters = 1,
    VariablesHoistedInParameters = 2 // a temp variable was hoisted while visiting a parameter list
}
enum 语法系统标志_ : int {
    无_ = 0,
    类型_ = 1,
    符号_ = 2,
    签名_ = 3,
    节点_ = 4
}
enum 流标志_ : int {
    无_ = 0,
    Unreachable = 1,
    Start = 2,
    BranchLabel = 4,
    LoopLabel = 8,
    Assignment = 16,
    TrueCondition = 32,
    FalseCondition = 64,
    SwitchClause = 128,
    ArrayMutation = 256,
    Call = 512,
    ReduceLabel = 1024,
    Referenced = 2048,
    Shared = 4096,
    类型断言_ = 8192,
    /** 标签 */
    Label = 12,
    /** 条件 */
    Condition = 96
}
enum EmitHint : long {
    源文件_ = 0L,
    Expression = 1L,
    IdentifierName = 2L,
    Unspecified = 3L,
    EmbeddedStatement = 4L
}
enum ListFormat : int {
    None = 0,
    // Line separators
    SingleLine = 0,
    MultiLine = 1,
    PreserveLines = 2,
    LinesMask = 3,
    // Delimiters
    NotDelimited = 0,
    BarDelimited = 4,
    AmpersandDelimited = 8,
    CommaDelimited = 16,
    AsteriskDelimited = 32,
    空白_ = 64,
    DelimitersMask = 124,
    AllowTrailingComma = 128,
    // Whitespace
    Indented = 256,
    SpaceBetweenBraces = 512,
    SpaceBetweenSiblings = 1024,
    // Brackets/Braces
    Braces = 2048,
    Parenthesis = 4096,
    AngleBrackets = 8192,
    SquareBrackets = 16384,
    BracketsMask = 30720,
    OptionalIfUndefined = 32768,
    OptionalIfEmpty = 65536,
    Optional = 98304,
    // Other
    PreferNewLine = 131072,
    NoTrailingNewLine = 262144,
    NoInterveningComments = 524288,
    NoSpaceIfEmpty = 1048576,
    SingleElement = 2097152,
    SpaceAfterList = 4194304,
    逗号间隔列表 = 1040,
    // Precomputed Formats
    Modifiers = 525312,
    HeritageClauses = 1024,
    SingleLineTypeLiteralMembers = 1536,
    MultiLineTypeLiteralMembers = 65793,
    SingleLineTupleTypeElements = 1040,
    MultiLineTupleTypeElements = 1297,
    UnionTypeConstituents = 1028,
    IntersectionTypeConstituents = 1032,
    ObjectBindingPatternElements = 1050256,
    ArrayBindingPatternElements = 1049744,
    ObjectLiteralExpressionProperties = 1052434,
    ArrayLiteralExpressionElements = 17810,
    动态类字面量表达式_ = 3474,
    结构类字面量表达式_ = 3474,
    CommaListElements = 1040,
    CallExpressionArguments = 5136,
    NewExpressionArguments = 37904,
    TemplateExpressionSpans = 524288,
    SingleLineBlockStatements = 1536,
    MultiLineBlockStatements = 257,
    VariableDeclarationList = 1040,
    SingleLineFunctionBodyStatements = 1536,
    MultiLineFunctionBodyStatements = 1,
    ClassHeritageClauses = 0,
    ClassMembers = 257,
    InterfaceMembers = 257,
    EnumMembers = 273,
    CaseBlockClauses = 257,
    NamedImportsOrExportsElements = 1050256,
    JsxElementOrFragmentChildren = 524288,
    JsxElementAttributes = 525312,
    CaseOrDefaultClauseStatements = 327937,
    HeritageClauseTypes = 1040,
    SourceFileStatements = 262145,
    Decorators = 4292609,
    TypeArguments = 107536,
    TypeParameters = 107536,
    运算符元素组_ = 17424,
    类型列表类型组_ = 1040,
    Parameters = 5136,
    IndexSignatureParameters = 17680,
    JSDocComment = 33,
    导入声明_ = 2321
}
enum 新行种类_ : int {
    无_ = 0,
    CarriageReturnLineFeed = 1,
    LineFeed = 2
}
enum TempFlags : int {
    Auto = 0,
    CountMask = 268435455,
    _i = 268435456
}
enum PipelinePhase : int {
    Notification = 0,
    Substitution = 1,
    Comments = 2,
    SourceMaps = 3,
    Emit = 4
}
class TypeChecker {
    this() { }
}
class 编译选项基类_ {
    dstring 语言id;
    源文件_ 配置源文件;
    this() { }
    this(dstring id) {
        this.语言id = id;
    }
}
class 操作已取消异常_ : Throwable {
    this() {
        super(""c);
    }
}
class 转换支持_ {
    this() { }
}
class RawSourceMap {
    int 版本_;
    dstring file;
    dstring sourceRoot;
    dstring[] sources;
    dstring[] sourcesContent;
    dstring mappings;
    dstring[] names;
    this() { }
    this(dstring file, dstring[] sources, dstring mappings, dstring sourceRoot = ··null!(dstring), dstring[] sourcesContent = ··null!(dstring[]), dstring[] names = ··null!(dstring[])) {
        this.版本_ = 3;
        this.file = file;
        this.sources = sources;
        this.mappings = mappings;
        this.sourceRoot = sourceRoot;
        this.sourcesContent = sourcesContent;
        this.names = names;
    }
}
class 输出结果_ {
    bool emitSkipped;
    /** Contains declaration emit diagnostics */
    诊断_[] diagnostics;
    dstring[] emittedDlangFiles;
    dstring[] emittedFiles; // Array of files the compiler wrote to disk
    /* @internal */ SourceMapEmitResult[] sourceMaps; // Array of sourceMapData if compiler emitted sourcemaps
    this() { }
    this(bool emitSkipped, 诊断_[] diagnostics, dstring[] emittedDlangFiles = ··null!(dstring[]), dstring[] emittedFiles = ··null!(dstring[]), SourceMapEmitResult[] sourceMaps = ··null!(SourceMapEmitResult[])) {
        this.emitSkipped = emitSkipped;
        this.diagnostics = diagnostics;
        this.emittedDlangFiles = emittedDlangFiles;
        this.emittedFiles = emittedFiles;
        this.sourceMaps = sourceMaps;
    }
}
class 输出转换组_ {
    转换工厂_!(节点_)[] 源码转换组;
    转换工厂_!(节点_)[] 声明转换组;
    this() { }
    this(转换工厂_!(节点_)[] 源码转换组, 转换工厂_!(节点_)[] 声明转换组) {
        this.源码转换组 = 源码转换组;
        this.声明转换组 = 声明转换组;
    }
}
class 编译器基类_ {
    this() { }
}
class 节点工厂_ {
    this() { }
}
class 文本范围_ {
    long 开始 = -1;
    long 结束 = -1;
    this() { }
}
class 注释范围_ : 文本范围_ {
    SK 种类;
    TK 目标;
    语法系统标志_ 系统标志;
    bool 有尾随新行;
    this() { }
    this(long 开始, long 结束, bool 有尾随新行) {
        this.种类 = SK.未知__;
        this.系统标志 = 语法系统标志_.无_;
        this.目标 = TK.无_;
        this.开始 = 开始;
        this.结束 = 结束;
        this.有尾随新行 = 有尾随新行;
    }
}
class 源映射范围_ : 注释范围_ {
    文本范围_ source;
    this() { }
    this(long 开始, long 结束, bool 有尾随新行) {
        super(开始, 结束, 有尾随新行);
        this.source = ··null!(文本范围_);
    }
}
class 语法系统_ : 源映射范围_ {
    long id;
    ulong 标志;
    void* 扩展;
    this() { }
    this(语法系统标志_ 系统标志, ulong 标志, long 开始 = -1, long 结束 = -1) {
        super(开始, 结束, false);
        this.标志 = 标志;
        this.系统标志 = 系统标志;
        this.id = 0;
        this.扩展 = ··null!(void*);
    }
}
class 类型_ : 语法系统_ {
    dstring 名称;
    符号_ 符号;
    size_t 大小;
    bool 成员已解析;
    this() { }
    this(TK 目标, long 标志) {
        super(语法系统标志_.类型_, 标志);
        this.种类 = SK.类型符号签名系统;
        this.名称 = ""d;
        this.符号 = ··null!(符号_);
        this.大小 = 0;
        this.成员已解析 = false;
    }
    this(TK 目标, long 标志, dstring 名称) {
        super(语法系统标志_.类型_, 标志);
        this.种类 = SK.类型符号签名系统;
        this.名称 = 名称;
        this.符号 = ··null!(符号_);
        this.大小 = 0;
        this.成员已解析 = false;
    }
    dstring 打印() {
        if (this.名称 !is ··null!(dstring)) {
            return this.名称;
        }
        else if (this.符号 !is ··null!(符号_)) {
            this.符号.打印();
        }
        return ""d;
    }
}
class 符号_ : 语法系统_ {
    符号_ 父符号;
    dstring 名称;
    节点_[] 声明组;
    节点_ 值声明;
    符号表_ 成员;
    void* 扩展;
    this() { }
    this(TK 目标, long 标志) {
        super(语法系统标志_.符号_, 标志);
        this.种类 = SK.类型符号签名系统;
        this.名称 = ""d;
        this.声明组 = [];
        this.值声明 = ··null!(节点_);
        this.父符号 = ··null!(符号_);
        this.成员 = ··null!(符号表_);
        this.扩展 = ··null!(void*);
    }
    this(TK 目标, long 标志, dstring 名称) {
        super(语法系统标志_.符号_, 标志);
        this.种类 = SK.类型符号签名系统;
        this.名称 = 名称;
        this.声明组 = [];
        this.值声明 = ··null!(节点_);
        this.父符号 = ··null!(符号_);
        this.成员 = ··null!(符号表_);
        this.扩展 = ··null!(void*);
    }
    dstring 打印() {
        if (this.父符号 !is ··null!(符号_)) {
            dstring 父名称 = this.父符号.打印();
            return 父名称 ~ "."d ~ this.名称;
        }
        else {
            return this.名称;
        }
    }
}
class 签名_ : 语法系统_ {
    this() { }
    this(TK 目标, long 标志) {
        super(语法系统标志_.签名_, 标志);
        this.种类 = SK.类型符号签名系统;
    }
}
class 流节点_ {
    流标志_ 标志 = 流标志_.无_;
    long id = 0;
    节点_ node;
    流节点_ target;
    节点_ switchStatement;
    流节点_ antecedent;
    流节点_[] antecedents;
    long clauseStart;
    long clauseEnd;
    this() { }
    this(流标志_ 标志) {
        this.标志 = 标志;
    }
}
class 解析的模块名称_ {
    dstring 模块名称;
    dstring 解析的模块路径;
    dstring[] 全部源码文件名;
    this() { }
    this(dstring 名称, dstring 路径, dstring[] 文件名组) {
        this.模块名称 = 名称;
        this.解析的模块路径 = 路径;
        this.全部源码文件名 = 文件名组;
    }
}
class 解析的模块包括查找失败位置_ {
    dstring[] 查找失败位置;
    解析的模块名称_ 模块目录路径;
    this() { }
    this(dstring[] 失败位置, 解析的模块名称_ 模块目录路径) {
        this.查找失败位置 = 失败位置;
        this.模块目录路径 = 模块目录路径;
    }
}
class 缓存包括重定向_(T) {
    词典_!(T) 主词典;
    this() { }
    this(词典_!(T) 词典) {
        this.主词典 = 词典;
    }
    词典_!(T) 获取或创建缓存重定向的词典() {
        return this.主词典;
    }
    void p·设置主词典(词典_!(T) 词典) {
        this.主词典 = 词典;
    }
    void 清除() {
        this.主词典.清除();
    }
}
class 每个模块名称缓存_ {
    解析的模块包括查找失败位置_ delegate(dstring) 获取;
    void delegate(dstring, 解析的模块包括查找失败位置_) 设置;
    this() { }
    this(解析的模块包括查找失败位置_ delegate(dstring) 获取, void delegate(dstring, 解析的模块包括查找失败位置_) 设置) {
        this.获取 = cast(解析的模块包括查找失败位置_ delegate(dstring))(获取);
        this.设置 = cast(void delegate(dstring, 解析的模块包括查找失败位置_))(设置);
    }
}
class 模块解析缓存_ {
    缓存包括重定向_!(词典_!(解析的模块包括查找失败位置_)) 目录转模块名词典;
    缓存包括重定向_!(每个模块名称缓存_) 模块名转换目录词典;
    dstring 当前目录;
    获取正规文件名函数_ 获取正规文件名;
    this() { }
    this(缓存包括重定向_!(词典_!(解析的模块包括查找失败位置_)) 目录词典, 缓存包括重定向_!(每个模块名称缓存_) 模块词典, dstring 当前目录, 获取正规文件名函数_ 获取正规文件名) {
        this.目录转模块名词典 = 目录词典;
        this.模块名转换目录词典 = 模块词典;
        this.当前目录 = 当前目录;
        this.获取正规文件名 = cast(获取正规文件名函数_)(获取正规文件名);
    }
    词典_!(解析的模块包括查找失败位置_) 获取或创建目录的缓存(dstring 目录名称) {
        dstring 路径 = 转为路径(目录名称, this.当前目录, this.获取正规文件名);
        return this.f·获取或创建缓存!(词典_!(解析的模块包括查找失败位置_))(this.目录转模块名词典, 路径, () { return 创建词典!(解析的模块包括查找失败位置_)(); });
    }
    每个模块名称缓存_ 获取或创建模块名的缓存(dstring 未解析模块名称) {
        return this.f·获取或创建缓存!(每个模块名称缓存_)(this.模块名转换目录词典, 未解析模块名称, cast(每个模块名称缓存_ delegate())(&this.创建每个模块名称缓存));
    }
    T f·获取或创建缓存(T)(缓存包括重定向_!(T) 缓存包括重定向, dstring 键, T delegate() 创建) {
        词典_!(T) 缓存 = 缓存包括重定向.获取或创建缓存重定向的词典();
        T 结果 = ··null!(T);
        if (缓存.具有(键)) {
            结果 = 缓存.获取(键);
        }
        if (结果 is ··null!(T)) {
            结果 = 创建();
            缓存.p·设置(键, 结果);
        }
        return 结果;
    }
    每个模块名称缓存_ 创建每个模块名称缓存() {
        解析的模块包括查找失败位置_ delegate(dstring) 获取;
        void delegate(dstring, 解析的模块包括查找失败位置_) 设置;
        dstring delegate(dstring, dstring) 计算前缀;
        词典_!(解析的模块包括查找失败位置_) 目录路径词典;
        解析的模块包括查找失败位置_ 获取·func(dstring 目录) {
            return 目录路径词典.获取(目录);
        }
        获取 = &获取·func;
        void 设置·func(dstring 目录, 解析的模块包括查找失败位置_ 结果) {
            dstring 路径;
            dstring 解析的文件名;
            路径 = 转为路径(目录, this.当前目录, this.获取正规文件名);
            if (目录路径词典.具有(路径)) {
                return;
            }
            目录路径词典.p·设置(路径, 结果);
            if (结果.模块目录路径 !is ··null!(解析的模块名称_)) {
                解析的文件名 = 结果.模块目录路径.解析的模块路径;
            }
            if (解析的文件名 !is ··null!(dstring)) {
                dstring 组件前缀 = 计算前缀(路径, 解析的文件名);
                dstring 当前 = 路径;
                while(当前 != 组件前缀) {
                    dstring 父路径 = 获取目录路径(当前);
                    if (父路径 == 当前 || 目录路径词典.具有(父路径)) {
                        break;
                    }
                    目录路径词典.p·设置(父路径, 结果);
                    当前 = 父路径;
                }
            }
        }
        设置 = &设置·func;
        dstring 计算前缀·func(dstring 目录, dstring 解析的) {
            dstring 解析目录;
            int i;
            long 限度;
            long 根长度;
            long 步幅;
            解析目录 = 转为路径(获取目录路径(解析的), this.当前目录, this.获取正规文件名);
            i = 0;
            限度 = 最小(目录.length, 解析目录.length);
            while(i < 限度 && 目录[i] == 解析目录[i]) {
                ++i;
            }
            if (i == 目录.length && (解析目录.length == i || 解析目录[i] == 目录分割符[0])) {
                return 目录;
            }
            根长度 = 获取根长度(目录);
            if (i < 根长度) {
                return ··null!(dstring);
            }
            步幅 = 从后查找索引(目录, 目录, i - 1);
            if (步幅 == -1) {
                return ··null!(dstring);
            }
            return 目录[0 .. 最大(步幅, 根长度)];
        }
        计算前缀 = &计算前缀·func;
        目录路径词典 = 创建词典!(解析的模块包括查找失败位置_)();
        return new 每个模块名称缓存_(cast(解析的模块包括查找失败位置_ delegate(dstring))(获取), cast(void delegate(dstring, 解析的模块包括查找失败位置_))(设置));
    }
}
class 打印机_ {
    this() { }
    dstring printNode(EmitHint hint, 节点_ node, 源文件_ sourceFile) {
        throw new Throwable(·to!(string)("未实现"d));
    }
    dstring printList(ListFormat format, 节点数组_!(节点_) list, 源文件_ sourceFile) {
        throw new Throwable(·to!(string)("未实现"d));
    }
    dstring printFile(源文件_ sourceFile) {
        throw new Throwable(·to!(string)("未实现"d));
    }
    void writeNode(EmitHint hint, 节点_ node, 源文件_ sourceFile = ··null!(源文件_), IEmitTextWriter writer = ··null!(IEmitTextWriter)) {
        throw new Throwable(·to!(string)("未实现"d));
    }
    void writeList(ListFormat format, 节点数组_!(节点_) list = ··null!(节点数组_!(节点_)), 源文件_ sourceFile = ··null!(源文件_), IEmitTextWriter writer = ··null!(IEmitTextWriter)) {
        throw new Throwable(·to!(string)("未实现"d));
    }
    void writeFile(源文件_ sourceFile, IEmitTextWriter writer, SourceMapGenerator sourceMapGenerator = ··null!(SourceMapGenerator)) {
        throw new Throwable(·to!(string)("未实现"d));
    }
}
class 打印选项_ : 编译选项基类_ {
    bool removeComments;
    新行种类_ newLine;
    bool omitTrailingSemicolon;
    bool noEmitHelpers;
    /*@internal*/ bool sourceMap;
    /*@internal*/ bool inlineSourceMap;
    /*@internal*/ bool inlineSources;
    /*@internal*/ bool extendedDiagnostics;
    /*@internal*/ bool onlyPrintJsDocStyle;
    /*@internal*/ bool neverAsciiEscape;
    /*@internal*/ bool writeBundleFileInfo;
    /*@internal*/ bool recordInternalSection;
    /*@internal*/ bool stripInternal;
    /*@internal*/ bool preserveSourceNewlines;
    /*@internal*/ bool terminateUnterminatedLiterals;
    /*@internal*/ dstring delegate(dstring) relativeToBuildInfo;
    this() { }
    this(dstring id) {
        super(id);
        this.newLine = 新行种类_.无_;
    }
}
struct 行和列_ {
    /** 0-based. */
    long 行;
    /*
     * 0-based. This value denotes the character position in line and is different from the 'column' because of tab characters.
     */
    long 列;
    this(long 行, long 列) {
        this.行 = 行;
        this.列 = 列;
    }
}
struct 命令行选项_ {
    dstring name;
    dstring type;
    dstring[dstring] types = ··null!(dstring[dstring]);
    bool isFilePath = ··null!(bool); // True if option value is a path or fileName
    dstring shortName = ··null!(dstring); // A short mnemonic for convenience - for instance, 'h' can be used in place of 'help'
    诊断消息_ description = ··null!(诊断消息_); // The message describing what the command line switch does
    诊断消息_ paramType = ··null!(诊断消息_); // The name to be used for a non-boolean option's parameter
    bool 只可在配置文件 = ··null!(bool); // True if option can only be specified via tsconfig.json file
    bool isCommandLineOnly = ··null!(bool);
    bool showInSimplifiedHelpView = ··null!(bool);
    诊断消息_ category = ··null!(诊断消息_);
    bool strictFlag = ··null!(bool); // true if the option is one of the flag under strict
    bool affectsSourceFile = ··null!(bool); // true if we should recreate SourceFiles 输出之后转换函数组 this option changes
    bool affectsModuleResolution = ··null!(bool); // currently same effect as `affectsSourceFile`
    bool affectsBindDiagnostics = ··null!(bool); // true if this affects binding (currently same effect as `affectsSourceFile`)
    bool affectsSemanticDiagnostics = ··null!(bool); // true if option affects semantic 诊断集_
    bool affectsEmit = ··null!(bool); // true if the options affects emit
    bool transpileOptionValue = ··null!(bool); // If set this means that the option should be set to this value when transpiling
    // TsConfigOnlyOption  : type: "object";
    命令行选项_[dstring] elementOptions = ··null!(命令行选项_[dstring]);
    诊断消息_ extraKey诊断消息_ = ··null!(诊断消息_);
    // CommandLineOptionOfListType  : type: "list";
    命令行选项_* element = ··null!(命令行选项_*);
    this(dstring name, dstring type) {
        this.name = name;
        this.type = type;
    }
}
interface 取消令牌_ {
    bool 是取消操作();
    void 抛出如果取消操作();
}
interface 输出解析器_ {
    前端接口_ 获取前端();
    程序主机接口_ 获取主机();
    转换支持_ 获取输出转换支持();
    long 获取词法种类数量();
}
/* @internal */
struct SourceMapEmitResult {
    dstring[] inputSourceFileNames; // Input source file (which one can use on program to get the file), 1:1 mapping with the sourceMap.sources list
    RawSourceMap sourceMap;
    this(dstring[] inputSourceFileNames, RawSourceMap sourceMap) {
        this.inputSourceFileNames = inputSourceFileNames;
        this.sourceMap = sourceMap;
    }
}
struct 定制转换组_ {
    /** Custom transformers to evaluate 输出之前转换函数组 built-in .js transformations. */
    转换工厂_!(源文件_)[] 输出之前转换函数组 = ··null!(转换工厂_!(源文件_)[]);
    /** Custom transformers to evaluate 输出之后转换函数组 built-in .js transformations. */
    转换工厂_!(源文件_)[] 输出之后转换函数组 = ··null!(转换工厂_!(源文件_)[]);
}
struct 转换上下文_ {
    /** Gets the compiler options supplied to the transformer. */
    编译选项基类_ delegate() getCompilerOptions = ··null!(编译选项基类_ delegate());
    /** Starts a new lexical environment. */
    void delegate() startLexicalEnvironment = ··null!(void delegate());
    /* @internal */ void delegate(LexicalEnvironmentFlags, bool) setLexicalEnvironmentFlags = ··null!(void delegate(LexicalEnvironmentFlags, bool));
    /* @internal */ LexicalEnvironmentFlags delegate() getLexicalEnvironmentFlags = ··null!(LexicalEnvironmentFlags delegate());
    /** Suspends the current lexical environment, usually after visiting a parameter list. */
    void delegate() suspendLexicalEnvironment = ··null!(void delegate());
    /** Resumes a suspended lexical environment, usually before visiting a function body. */
    void delegate() resumeLexicalEnvironment = ··null!(void delegate());
    /** Ends a lexical environment, returning any declarations. */
    节点_[] delegate(节点_ delegate(节点_[])) endLexicalEnvironment = ··null!(节点_[] delegate(节点_ delegate(节点_[])));
    /** Hoists a function declaration to the containing scope. */
    void delegate(节点_) hoistFunctionDeclaration = ··null!(void delegate(节点_));
    /** Hoists a variable declaration to the containing scope. */
    void delegate(节点_) hoistVariableDeclaration = ··null!(void delegate(节点_));
    /*@internal*/ void delegate() startBlockScope = ··null!(void delegate());
    /*@internal*/ 节点_[] delegate(节点_ delegate(节点_)) endBlockScope = ··null!(节点_[] delegate(节点_ delegate(节点_)));
    /*@internal*/ void delegate(节点_) addBlockScopedVariable = ··null!(void delegate(节点_));
    /** Adds an initialization statement to the top of the lexical environment. */
    /* @internal */
    void delegate(节点_) addInitializationStatement = ··null!(void delegate(节点_));
    /*@internal*/ 输出解析器_ delegate() getEmitResolver = ··null!(输出解析器_ delegate());
    /*@internal*/ 程序主机接口_ delegate() getEmitHost = ··null!(程序主机接口_ delegate());
    /** Enables expression substitutions in the pretty printer for the provided 整数_. */
    void delegate(long) enableSubstitution = ··null!(void delegate(long));
    /** Determines whether expression substitutions are enabled for the provided node. */
    bool delegate(节点_) isSubstitutionEnabled = ··null!(bool delegate(节点_));
    /**
     * Hook used by transformers to substitute expressions just before they
     * are emitted by the pretty printer.
     *
     * NOTE: Transformation hooks should only be modified during `Transformer` initialization,
     * before returning the `NodeTransformer` callback.
     */
    OnSubstituteNode_ onSubstituteNode = ··null!(OnSubstituteNode_);
    /**
     * Enables before/after emit notifications in the pretty printer for the provided
     * 整数_.
     */
    void delegate(long) enableEmitNotification = ··null!(void delegate(long));
    /**
     * Determines whether before/after emit notifications should be raised in the pretty
     * printer when it emits a node.
     */
    bool delegate(节点_) isEmitNotificationEnabled = ··null!(bool delegate(节点_));
    /**
     * Hook used to allow transformers to capture state before or after
     * the printer emits a node.
     *
     * NOTE: Transformation hooks should only be modified during `Transformer` initialization,
     * before returning the `NodeTransformer` callback.
     */
    OnEmitNode_ onEmitNode = ··null!(OnEmitNode_);
    /* @internal */ void delegate(诊断_) addDiagnostic = ··null!(void delegate(诊断_));
    void delegate() enabledSyntaxKindFeaturesRe = ··null!(void delegate());
}
struct TransformationResult {
    /** Gets the transformed source files. */
    节点_[] transformed = ··null!(节点_[]);
    /** Gets diagnostics for the transformation. */
    诊断_[] diagnostics = ··null!(诊断_[]);
    /**
     * Gets a substitute for a node, if one is available; otherwise, returns the original node.
     *
     * @param hint A hint as to the intended usage of the node.
     * @param node The node to substitute.
     */
    OnSubstituteNode_ substituteNode = ··null!(OnSubstituteNode_);
    /**
     * Emits a node with possible notification.
     *
     * @param hint A hint as to the intended usage of the node.
     * @param node The node to emit.
     * @param emitCallback A callback used to emit the node.
     */
    OnEmitNode_ emitNodeWithNotification = ··null!(OnEmitNode_);
    /**
     * Indicates if a given node needs an emit notification
     *
     * @param node The node to emit.
     */
    bool delegate(节点_) isEmitNotificationEnabled = ··null!(bool delegate(节点_));
    /**
     * Clean up EmitNode entries on any parse-tree nodes.
     */
    void delegate() dispose = ··null!(void delegate());
}
interface 检查_ {
    诊断_[] 获取诊断组(源文件_ 源文件, 取消令牌_ 取消令牌 = ··null!(取消令牌_));
    诊断_[] 获取全局诊断组();
    输出解析器_ 获取输出解析器(源文件_ 源文件 = ··null!(源文件_), 取消令牌_ 取消令牌 = ··null!(取消令牌_));
}
interface 设置扫描_ {
    TK 获取语言目标();
    dstring[] 文本引号组();
    dchar[][] 文本内部关注字符();
    bool[] 引号内文本是否可换行设置组();
    dstring 单行注释头();
    dstring 多行注释头();
    dstring 多行注释尾();
    dstring[] 组合令牌设置();
    dchar[] 单行注释内特殊关注字符();
    dchar[] 多行注释内特殊关注字符();
    标识符字符判断函数_ 获取标识符开始判断函数();
    标识符字符判断函数_ 获取标识符片段片段函数();
}
interface 前端接口_ {
    源文件_ 创建源文件(dstring 文件名, dstring 内容, 解析的模块名称_ 解析的 = ··null!(解析的模块名称_));
    前端编译器接口_ 创建前端编译器(编译器基类_ 编译);
    遍历节点函数类型_ 获取遍历节点();
    检查源文件函数_ 获取检查源文件函数(程序主机接口_ 主机, bool 诊断, 诊断收集_ 诊断集);
    TK 获取前端目标();
    dstring 获取语言id();
    dstring[] 获取支持的扩展();
    dstring[] 获取语言配置文件名();
    命令行选项_ 获取根选项();
    命令行选项_[] 获取编译选项组();
    设置扫描_ 获取扫描设置();
    bool 是监控设置(编译选项基类_ 选项);
    检查源文件函数_ 获取引用模块收集函数(编译主机接口_ 主机);
    解析的模块名称_[] 加载模块(dstring[] 模块名称组, dstring 包含文件);
    dstring[] 获取默认支持库文件名组();
    绑定函数_ 获取绑定工作站(绑定子函数_ 绑定, 程序主机接口_ 主机);
    绑定函数_ 获取绑定子工作站();
    清理函数_ 获取绑定清理();
    初始源文件检查函数_ 获取源文件初始检查函数();
    检查初始化函数_ 获取检查初始化函数();
    源文件准备函数_ 获取源文件输出准备函数();
    打印机_ 创建输出打印机(TransformationResult r);
    打印机_ 创建打印机(打印选项_ 选项, 打印助手_ 助手);
    输出转换组_ getTransformers();
    bool 是应输出的文件(源文件_ 文件);
    long 获取词法种类数量();
    转换支持_ 获取转换支持();
}
interface 前端编译器接口_ {
    源文件_ 编译源文件();
    void 清理();
}
interface 编译主机接口_ {
    前端接口_ 获取前端();
    编译选项基类_ 获取编译选项();
    dstring 获取执行文件路径();
    dstring 获取当前目录();
    bool 文件存在(dstring 文件名);
    bool 目录存在(dstring 目录);
    dstring 读文件(dstring 文件名);
    dstring[] 读目录(dstring 路径, dstring[] 扩展组 = ··null!(dstring[]), dstring[] 排除组 = ··null!(dstring[]), dstring[] 包含组 = ··null!(dstring[]), int 深度 = ··null!(int));
    void 追踪(诊断消息_ 消息, dstring[] args);
    模块解析缓存_ 创建模块解析缓存();
    dstring getCanonicalFileName(dstring 文件名);
    bool useCaseSensitiveFileNames();
}
interface 程序主机接口_ : 编译主机接口_ {
    输出结果_ 输出(源文件_ 源文件 = ··null!(源文件_), 写文件回调_ 写文件回调 = ··null!(写文件回调_), 取消令牌_ 取消令牌 = ··null!(取消令牌_), 定制转换组_ transformers = ··null!(定制转换组_));
    源文件_ 获取源文件(dstring 文件名);
    源文件_[] 获取源文件组();
    源文件_[][] 准备输出源文件(源文件_[] 源文件);
}
// This was previously deprecated in our public API, but is still used internally
/* @internal */
interface ISymbolWriter {
    void writeKeyword(dstring text);
    void writeOperator(dstring text);
    void writePunctuation(dstring text);
    void writeSpace(dstring text);
    void writeStringLiteral(dstring text);
    void writeParameter(dstring text);
    void writeProperty(dstring text);
    void writeSymbol(dstring text, 符号_ symbol);
    void writeLine(bool force = ··null!(bool));
    void increaseIndent();
    void decreaseIndent();
    void clear();
}
/* @internal */
interface IEmitTextWriter : ISymbolWriter {
    void write(dstring s);
    void writeTrailingSemicolon(dstring text);
    void writeComment(dstring text);
    dstring getText();
    void rawWrite(dstring s);
    void writeLiteral(dstring s);
    long getTextPos();
    long getLine();
    long getColumn();
    long getIndent();
    bool isAtStartOfLine();
    bool hasTrailingComment();
    bool hasTrailingWhitespace();
    long getTextPosWithWriteLine();
    long getIndentSize();
    dstring getIndentString(long level);
}
interface SourceMapGenerator {
    dstring[] getSources();
    long addSource(dstring fileName);
    void setSourceContent(long sourceIndex, dstring content);
    long addName(dstring name);
    void addMapping(long generatedLine, long generatedCharacter);
    void addMapping(long generatedLine, long generatedCharacter, long sourceIndex, long sourceLine, long sourceCharacter, long nameIndex = ··null!(long));
    void appendSourceMap(long generatedLine, long generatedCharacter, RawSourceMap sourceMap, dstring sourceMapPath, 行和列_ start = ··null!(行和列_), 行和列_ end = ··null!(行和列_));
    RawSourceMap toJSON();
    dstring 转为文本();
}
struct 打印助手_ {
    bool delegate(dstring) hasGlobalName = ··null!(bool delegate(dstring));
    void delegate(EmitHint, 节点_, void delegate(EmitHint, 节点_)) onEmitNode = ··null!(void delegate(EmitHint, 节点_, void delegate(EmitHint, 节点_)));
    bool delegate(节点_) isEmitNotificationEnabled = ··null!(bool delegate(节点_));
    节点_ delegate(EmitHint, 节点_) substituteNode = ··null!(节点_ delegate(EmitHint, 节点_));
    /*@internal*/ void delegate(EmitHint, 节点_, void delegate(EmitHint, 节点_)) onEmitSourceMapOfNode = ··null!(void delegate(EmitHint, 节点_, void delegate(EmitHint, 节点_)));
    /*@internal*/ long delegate(节点_, long, void delegate(dstring), long, long delegate(long, void delegate(dstring), long)) onEmitSourceMapOfToken = ··null!(long delegate(节点_, long, void delegate(dstring), long, long delegate(long, void delegate(dstring), long)));
    /*@internal*/ void delegate(long) onEmitSourceMapOfPosition = ··null!(void delegate(long));
    /*@internal*/ void delegate(源文件_) onSetSourceFile = ··null!(void delegate(源文件_));
    /*@internal*/ void delegate(节点_) onBeforeEmitNode = ··null!(void delegate(节点_));
    /*@internal*/ void delegate(节点_) onAfterEmitNode = ··null!(void delegate(节点_));
    /*@internal*/ void delegate(节点数组_!(节点_)) onBeforeEmitNodeArray = ··null!(void delegate(节点数组_!(节点_)));
    /*@internal*/ void delegate(节点数组_!(节点_)) onAfterEmitNodeArray = ··null!(void delegate(节点数组_!(节点_)));
    /*@internal*/ void delegate(节点_) onBeforeEmitToken = ··null!(void delegate(节点_));
    /*@internal*/ void delegate(节点_) onAfterEmitToken = ··null!(void delegate(节点_));
}
